<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>

<script>
	//原型模式
	function Person(){

	}

	Person.prototype.name = 'hongwei';
	Person.prototype.age = 34;
	Person.prototype.job = 'PHP Developer';
	Person.prototype.sayName = function(){
		alert(this.name);
	};

	var person1 = new Person();
	person1.sayName();

	var person2 = new Person();
	person2.sayName();
</script>
</html>